/*
 * @Author: your name
 * @Date: 2020-10-19 14:30:28
 * @LastEditTime: 2021-01-15 08:59:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \sende_nuxt\api\content.js
 */
// import axios from 'axios';
import request from '~/plugins/axios';
import cache from '@/utils/cache';
// import qs from 'qs';

const BASEURL = '[filterGroups][0][filters][0][field]=is_active&searchCriteria[filterGroups][0][filters][0][value]=1&searchCriteria[filterGroups][0][filters][0][conditionType]=eq'
// 获取导航菜单
const getCategories = () => {
    return request.get('/categories/list?searchCriteria', {
        params: {BASEURL},
        adapter: cache({ time: 0})
    })
}
// 获取首页轮播图
const getHomeBanner = () => {
    return request.get('/sparsh/banner', {adapter: cache({ time: 0})})
}
// 获取首页产品展示轮播
const getHomeCatalog = () => {
    return request.get('/maijindou/catalog')
}

export {
    getCategories,
    getHomeBanner,
    getHomeCatalog
}